﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Text;

namespace SongBuilder
{
	public abstract class Song
	{
		private int duration;
		private List<Bar> bars = new List<Bar>();

		public Song(int duration, params Bar[] bars)
		{
			this.duration = duration;
			this.bars.AddRange(bars);
		}

		public int Duration { get { return this.duration; } }

		protected ICollection<Bar> Bars
		{
			get { return this.bars; }
		}

		public void Play()
		{
			for (int x = 0; x < this.bars.Count; x++)
				this.bars[x].Play(this.duration);
		}
	}
}